home *** CD-ROM | disk | FTP | other *** search
/ Champak 114 / Vol 114.iso / games / pico_2.swf / scripts / DefineSprite_772 / frame_1 / DoAction.as
Encoding:
Text File  |  2010-08-12  |  648 b   |  40 lines

  1. function updateIt()
  2. {
  3.    i = 0;
  4.    while(i < tot)
  5.    {
  6.       var hid = eval("bg" + i);
  7.       hid._visible = false;
  8.       i++;
  9.    }
  10.    sho = eval("bg" + this.num);
  11.    sho._visible = true;
  12. }
  13. this.tot = 5;
  14. this.num = 0;
  15. updateIt();
  16. upp.onPress = function()
  17. {
  18.    if(this._parent.num < this._parent.tot - 1)
  19.    {
  20.       this._parent.num += 1;
  21.    }
  22.    else
  23.    {
  24.       this._parent.num = 0;
  25.    }
  26.    this._parent.updateIt();
  27. };
  28. dwn.onPress = function()
  29. {
  30.    if(this._parent.num > 0)
  31.    {
  32.       this._parent.num -= 1;
  33.    }
  34.    else
  35.    {
  36.       this._parent.num = this._parent.tot - 1;
  37.    }
  38.    this._parent.updateIt();
  39. };
  40.